package com.iflytek.iot.platform.tracing.threadlocal;

/**
 * @author zurun
 * @date 2019/2/16 15:03:46
 */
public class IotTracingThreadLocal {
    private static final ThreadLocal<ThreadLocalEntity> context = ThreadLocal.withInitial(ThreadLocalEntity::new);

    public static ThreadLocalEntity setType(String type) {
        return context.get().setType(type);
    }

    public static ThreadLocalEntity setRoom(String room) {
        return context.get().setRoom(room);
    }

    public static ThreadLocalEntity setCmd(String cmd) {
        return context.get().setCmd(cmd);
    }

    public static ThreadLocalEntity setPodid(String podid) {
        return context.get().setPodid(podid);
    }

    public static ThreadLocalEntity setInner(String inner) {
        return context.get().setInner(inner);
    }

    public static ThreadLocalEntity setDeviceid(String deviceid) {
        return context.get().setDeviceid(deviceid);
    }

    public static ThreadLocalEntity setCtei(String ctei) {
        return context.get().setCtei(ctei);
    }

    public static ThreadLocalEntity setImei(String imei) {
        return context.get().setImei(imei);
    }

    public static ThreadLocalEntity setManufacturer(String manufacturer) {
        return context.get().setManufacturer(manufacturer);
    }

    public static ThreadLocalEntity setModel(String model) {
        return context.get().setModel(model);
    }

    public static ThreadLocalEntity setCategory(String category) {
        return context.get().setCategory(category);
    }

    public static ThreadLocalEntity setCaller(String caller) {
        return context.get().setCaller(caller);
    }

    public static ThreadLocalEntity setUid(String uid) {
        return context.get().setUid(uid);
    }

    public static ThreadLocalEntity setRetcode(String retcode) {
        return context.get().setRetcode(retcode);
    }

    public static ThreadLocalEntity setRetdesc(String retdesc) {
        return context.get().setRetdesc(retdesc);
    }

    public static ThreadLocalEntity setCpname(String cpname) {
        return context.get().setCpname(cpname);
    }

    public static ThreadLocalEntity getEntity() {
        return context.get();
    }

    public static void setEntity(ThreadLocalEntity entity){
        context.set(entity);
    }

    public static ThreadLocalEntity setSequenceNo(String sequenceNo){
        return context.get().setSequenceNo(sequenceNo);
    }

    public static ThreadLocalEntity setOsid(String osid){
        return context.get().setOsid(osid);
    }

    public static ThreadLocalEntity setReqpkg(String reqpkg) {
        return context.get().setReqpkg(reqpkg);
    }

    public static ThreadLocalEntity setRespkg(String respkg) {
        return context.get().setRespkg(respkg);
    }

    public static ThreadLocalEntity setBrandname(String brandname) {
        return context.get().setBrandname(brandname);
    }

    public static ThreadLocalEntity setDevicesn(String devicesn) {
        return context.get().setDevicesn(devicesn);
    }

    public static ThreadLocalEntity setPlatform(String platform) {
        return context.get().setPlatform(platform);
    }

    public static void remove() {
        context.remove();
    }
}
